package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 体检套餐表
 * @TableName tb_package
 */
@TableName(value ="tb_package")
@Data
public class TbPackage {
    /**
     * 套餐ID（如 SWTT001）
     */
    @TableId(type = IdType.AUTO)
    private String packageId;

    /**
     * 套餐名称（唯一）
     */
    private String packageName;

    /**
     * 套餐图片路径（可空）
     */
    private String packageImage;

    /**
     * 套餐类型（如老年人套餐、成人套餐）
     */
    private String packageType;

    /**
     * 适用院区（仅限东院/西院）
     */
    private Object applicableHospital;

    /**
     * 套餐价格（元，保留2位小数）
     */
    private BigDecimal price;

    /**
     * 套餐项目（逗号分隔，如“一般检查,内科检查”）
     */
    private String packageItems;

    /**
     * 套餐状态（1=启用，0=禁用）
     */
    private Integer status;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbPackage other = (TbPackage) that;
        return (this.getPackageId() == null ? other.getPackageId() == null : this.getPackageId().equals(other.getPackageId()))
            && (this.getPackageName() == null ? other.getPackageName() == null : this.getPackageName().equals(other.getPackageName()))
            && (this.getPackageImage() == null ? other.getPackageImage() == null : this.getPackageImage().equals(other.getPackageImage()))
            && (this.getPackageType() == null ? other.getPackageType() == null : this.getPackageType().equals(other.getPackageType()))
            && (this.getApplicableHospital() == null ? other.getApplicableHospital() == null : this.getApplicableHospital().equals(other.getApplicableHospital()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getPackageItems() == null ? other.getPackageItems() == null : this.getPackageItems().equals(other.getPackageItems()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPackageId() == null) ? 0 : getPackageId().hashCode());
        result = prime * result + ((getPackageName() == null) ? 0 : getPackageName().hashCode());
        result = prime * result + ((getPackageImage() == null) ? 0 : getPackageImage().hashCode());
        result = prime * result + ((getPackageType() == null) ? 0 : getPackageType().hashCode());
        result = prime * result + ((getApplicableHospital() == null) ? 0 : getApplicableHospital().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getPackageItems() == null) ? 0 : getPackageItems().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", packageId=").append(packageId);
        sb.append(", packageName=").append(packageName);
        sb.append(", packageImage=").append(packageImage);
        sb.append(", packageType=").append(packageType);
        sb.append(", applicableHospital=").append(applicableHospital);
        sb.append(", price=").append(price);
        sb.append(", packageItems=").append(packageItems);
        sb.append(", status=").append(status);
        sb.append("]");
        return sb.toString();
    }
}